<?php

declare(strict_types=1);

namespace Modules\Promanagement\Models;

use Catch\Base\CatchModel as Model;

/**
 * @property $id
 * @property $pflcode
 * @property $processname
 * @property $description
 * @property $modifier
 * @property $creator_id
 * @property $created_at
 * @property $updated_at
 * @property $deleted_at
*/
class Processflow extends Model
{
    

    protected $table = 'processflow';

    protected $casts = [ 
        'purchaseorder_id' => 'array', 
    ]; 

    protected $fillable = [ 'id', 'pflcode', 'processname', 'description', 'modifier', 'creator_id', 'created_at', 'updated_at', 'deleted_at' ];

    /**
     * @var array
     */
    protected array $fields = ['id','pflcode','processname','description','modifier','created_at','updated_at', 'creator_id'];

    /**
     * @var array
     */
    protected array $form = ['id','pflcode','processname','description','modifier','created_at','updated_at', 'creator_id'];

    
    /**
     * @var array
     */
    public array $searchable = [
        'pflcode' => 'like',
        'processname' => 'like',
        'description' => 'like',
    ];
       /**
     * 链表查询
     */
    // public function detailscheckAll($purchaseorder_id)
    // {
    //     return $this->hasMany(Processdata::class)->whereIn('id',$purchaseorder_id);//查一条
    // }
/**
     * 链表查询
     */
    public function detailscheckOne()
    {
        return $this->hasOne(Provflowsional::class);//查一条
    }

    public function detailscheckAll()
    {
        return $this->hasMany(Provflowsional::class);//查多条
    }

    
}
